from django.db import models

# Create your models here.
class Store (models.Model):
    name = models.CharField (max_length=40)
    image = models.ImageField ('coupons', upload_to='images/store-coupons', null=True, blank=True)

    def __unicode__(self):
        return self.name

    class Meta:
        ordering = ('name', )

class Item (models.Model):
    name = models.CharField (max_length=40)
    quantity = models.IntegerField ()
    unit = models.CharField (max_length=20)
    image = models.ImageField ('picture', upload_to='images/items', null=True, blank=True)
    store = models.ManyToManyField (Store)

    def __unicode__(self):
        return self.name

    class Meta:
        ordering = ('name', )

